package com.itheima.volitale.男孩和女孩;

public class Boy {
    public static void main(String[] args) {
        grilThread gril = new grilThread();
        gril.start();

        while (true) {
            if (grilThread.money < 10) {
                System.out.println("钱已经不是十万了");
                break;
            }
        }
    }
}

class grilThread extends Thread{
    public static volatile int money=10;


    public void run() {
        try {
            grilThread.sleep(200);
            money-=5;
            System.out.println("女孩数了下，还剩"+money+"元");

        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}
